/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import model.Documento;
import util.jpaUtil;
/**
 *
 * @author calandreli
 */
public class DocumentoDAO extends JPAHibernateDAO{

    @Override
    public Class obterClasse() {
    return Documento.class;
    }
    public List<Documento> pesquisarDocumentoCod(int cod) {
        EntityManager em = jpaUtil.getEntityManager();
        Query query = em.createQuery("Select t from Documento t where t.processo = :cod");
        query.setParameter("cod", cod);
        return query.getResultList();
    }

// public List<Documento> listarTodosDocumento(int cod) {
//        EntityManager em = jpaUtil.getEntityManager();
//        Query query = em.createQuery(" Select e from Documento e where e.processo = :cod");
//        query.setParameter("cod", cod);
//        return query.getResultList();
//    }




}
